public class 工厂模式 {
    public static void main(String[] args) {
        Factorya factorya =new AppleFactoryaImpl();
        Phonea phonea = factorya.create();
        phonea.call();

    }
}
interface Factorya {
    public Phonea create();

    Mask N95Create();
}
class AppleFactoryaImpl implements Factorya
{
    @Override
    public Phonea create() {
        return new Applea();
    }

    @Override
    public Mask N95Create() {
        return null;
    }

}
class HuaWeiFactoryaImpl implements Factorya
{
    @Override
    public Phonea create() {
        return new HuaWeia();
    }

    @Override
    public Mask N95Create() {
        return null;
    }

}



interface Phonea
{
    public void call();


}
class Applea implements Phonea
{
    @Override
    public void call() {
        System.out.println("apple");
    }

}
class HuaWeia implements Phonea
{
    @Override
    public void call() {
        System.out.println("HuaWei");
    }


}
